home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Washington_1988 / DevCon88.3 / Printer / src / EpsonQ / density.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  1.1 KB  |  37 lines

  1. /*
  2.     Density module for EpsonQ driver.
  3.     David Berezowski - October/87
  4.  
  5.   Copyright (c) 1988 Commodore-Amiga, Inc.
  6.  
  7.   Executables based on this information may be used in software
  8.   for Commodore Amiga computers.  All other rights reserved.
  9.  
  10.   This information is provided "as is"; no warranties are made.
  11.   All use is at your own risk, and no liability or responsibility is assumed.
  12. */
  13.  
  14.  
  15. #include <exec/types.h>
  16. #include "../printer/printer.h"
  17. #include "../printer/prtbase.h"
  18.  
  19. SetDensity(density_code)
  20. ULONG density_code;
  21. {
  22.     extern struct PrinterData *PD;
  23.     extern struct PrinterExtendedData *PED;
  24.  
  25.     /* SPECIAL_DENSITY     0   1   2    3    4    5    6    7 */
  26.     static int XDPI[8] = {90, 90, 120, 180, 360, 360, 360, 360};
  27.     static char codes[8] = {38, 38, 33, 39, 40, 40, 40, 40};
  28.  
  29.     PED->ped_MaxColumns = 
  30.         PD->pd_Preferences.PaperSize == W_TRACTOR ? 136 : 80;
  31.     density_code /= SPECIAL_DENSITY1;
  32.     /* default is 80 chars (8.0 in.), W_TRACTOR is 136 chars (13.6 in.) */
  33.     PED->ped_MaxXDots = (XDPI[density_code] * PED->ped_MaxColumns) / 10;
  34.     PED->ped_XDotsInch = XDPI[density_code];
  35.     return(codes[density_code]);
  36. }
  37.